<template>
    <div class="block">
        <el-row type="flex">
            <el-col :span="1">
                <el-button type="text" icon="el-icon-back" round @click="prev">返回</el-button>
            </el-col>
        </el-row>
        <el-row type="flex" class="row-bg1" justify="center">
            <el-col :span="6">
                <h3> {{ notice.subtitle}}</h3>
            </el-col>
        </el-row>
        <el-row type="flex" class="row-bg2" justify="center">
            <el-col :span="6">
                <span> 来自：{{ notice.sendFromName}}</span> <span>时间 ：{{notice.createTime}}</span>
            </el-col>
        </el-row>
                
        <el-row type="flex" class="row-bg3" justify="center">
            <el-col :span="6">
                <div v-html="notice.noticeInfo">
                    {{
                        notice.noticeInfo
                    }}
                </div>                
            </el-col>
        </el-row>
    </div>
</template>

<script>
import bus from '../../../api/eventBus';
import log from '../../../api/log';
import notice from '../../../api/notice';

export default {
    name:"noticeDetails",
    data(){
        return{
            notice:'',
            noticeId:''
        }
    },
    created(){
        this.getNoticeId()
    },
    mounted(){

    },
    methods:{
        getNoticeId(){
            bus.$on("noticeId", res => {
                this.getNoticeMsg(res);
            })

        },
        async getNoticeMsg(res){
            const ress = await notice.getNoticeById({noticeId :res});
            if( ress.data.code === '000'){
                this.notice =ress.data.data
            }
        },
        prev(){
            this.$router.go(-1)
        }

    }
}
</script>

<style lang="scss" scoped >
.block{
    width:100%;
    background:white;
    height:450px;
    .row-bg1{
        padding-top: 15px;
    }
    .row-bg2{
        margin-top: 15px;
        margin-bottom: 15px;
    }   
    .row-bg3{
        width: 100%;
        height: 450px;
        background:rgb(199, 247, 199);
    }
}
</style>
